home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update34.zoo / gcc-250 / gcc.diff next >
Encoding:
Text File  |  1993-10-28  |  2.0 KB  |  77 lines

  1. *** c-typeck.c    1993/10/26 17:00:09    1.152
  2. --- c-typeck.c    1993/10/27 19:51:28
  3. ***************
  4. *** 3469,3475 ****
  5.         if (field)
  6.       {
  7.         char *name;
  8. !       tree nvalue;
  9.   
  10.         if (pedantic)
  11.           pedwarn ("ANSI C forbids casts to union type");
  12. --- 3469,3475 ----
  13.         if (field)
  14.       {
  15.         char *name;
  16. !       tree t;
  17.   
  18.         if (pedantic)
  19.           pedwarn ("ANSI C forbids casts to union type");
  20. ***************
  21. *** 3482,3490 ****
  22.           }
  23.         else
  24.           name = "";
  25. !       return digest_init (type, build (CONSTRUCTOR, type, NULL_TREE,
  26. !                        build_tree_list (field, value)),
  27. !                   0, 0);
  28.       }
  29.         error ("cast to union type from type not present in union");
  30.         return error_mark_node;
  31. --- 3482,3492 ----
  32.           }
  33.         else
  34.           name = "";
  35. !       t = digest_init (type, build (CONSTRUCTOR, type, NULL_TREE,
  36. !                     build_tree_list (field, value)),
  37. !                0, 0);
  38. !       TREE_CONSTANT (t) = TREE_CONSTANT (value);
  39. !       return t;
  40.       }
  41.         error ("cast to union type from type not present in union");
  42.         return error_mark_node;
  43. ***************
  44. *** 4033,4038 ****
  45. --- 4035,4044 ----
  46.     switch (TREE_CODE (value))
  47.       {
  48.       case CONSTRUCTOR:
  49. +       if (TREE_CODE (TREE_TYPE (value)) == UNION_TYPE
  50. +       && TREE_CONSTANT (value))
  51. +     return initializer_constant_valid_p (TREE_VALUE (CONSTRUCTOR_ELTS (value)));
  52. +     
  53.         return TREE_STATIC (value) ? null_pointer_node : 0;
  54.   
  55.       case INTEGER_CST:
  56. ***************
  57. *** 5688,5695 ****
  58.                      0);
  59.             goto retry;
  60.           }
  61. !       else if (tree_int_cst_lt (DECL_FIELD_BITPOS (TREE_PURPOSE (tail)),
  62. !                     DECL_FIELD_BITPOS (constructor_unfilled_fields)))
  63.           ;
  64.         else if (next == 0
  65.              || tree_int_cst_lt (DECL_FIELD_BITPOS (TREE_PURPOSE (tail)),
  66. --- 5694,5702 ----
  67.                      0);
  68.             goto retry;
  69.           }
  70. !       else if (constructor_unfilled_fields == 0
  71. !            || tree_int_cst_lt (DECL_FIELD_BITPOS (TREE_PURPOSE (tail)),
  72. !                        DECL_FIELD_BITPOS (constructor_unfilled_fields)))
  73.           ;
  74.         else if (next == 0
  75.              || tree_int_cst_lt (DECL_FIELD_BITPOS (TREE_PURPOSE (tail)),
  76.  
  77.